﻿@Html.DevExpress().GridView(
            settings =>
            {
                settings.Name = "gvEditing";
                settings.KeyFieldName = "ZSXH";
                settings.CallbackRouteValues = new { Controller = "GSImportDate", Action = "GSImportDateListPartial" };
                settings.Width =System.Web.UI.WebControls.Unit.Pixel(1800);

                settings.Columns.Add("NSRSBH", "纳税识别号");
                settings.Columns.Add("YZPZXH", "应征凭证序号");
                settings.Columns.Add("ZSXM_MC", "征收项目");
                settings.Columns.Add("YSKM_MC", "预算科目");
                settings.Columns.Add("SE", "税额");
                settings.Columns.Add("TZLX_MC", "申报调帐类型");
                settings.Columns.Add("SSSQ_Qstr", "所属期始");
                settings.Columns.Add("SSSQ_Zstr", "所属期止");
                settings.Columns.Add("YZPZZL_MC", "票证种类");
                settings.Columns.Add("YSSPHM", "系统税票号码");
                settings.Columns.Add("SKSX_MC", "税款属性");
                settings.Columns.Add("YSFPBL_MC", "预算分配比例");
                settings.Columns.Add("SJRQstr", "上解日期");
                settings.Columns.Add("RKRQstr", "入库日期");

               
                settings.SettingsBehavior.AllowSort = false;
                settings.SettingsBehavior.AllowDragDrop = false;
                settings.SettingsBehavior.AllowSelectByRowClick = false;
                settings.SettingsLoadingPanel.Text = "数据读取中...";
                settings.SettingsBehavior.AllowClientEventsOnLoad = false;
                settings.SettingsBehavior.AllowFocusedRow = true;


                settings.ClientSideEvents.BeginCallback = "function(s,e){OnBeginCallback(s,e)}";
                settings.Settings.ShowFooter = false;
                settings.CommandColumn.Visible = false;
                settings.CommandColumn.ShowSelectCheckbox = false;
                settings.CommandColumn.Width = System.Web.UI.WebControls.Unit.Pixel(5);

                settings.SettingsPager.Position = System.Web.UI.WebControls.PagerPosition.Bottom;
                settings.SettingsPager.FirstPageButton.Visible = true;
                settings.SettingsPager.LastPageButton.Visible = true;
                settings.SettingsPager.PageSize = EnterpriseFund.Common.GlobalConstant.CONSTRING_PAGESIZE;
                settings.SettingsPager.AlwaysShowPager = true;

                settings.TotalSummary.Add(DevExpress.Data.SummaryItemType.Sum, "SE").DisplayFormat = "合计:{0}";
                settings.Settings.ShowFooter = true;

                
                settings.PageIndexChanged = (sender, e) =>
                {
                    ASPxGridView grid = (ASPxGridView)sender;
                    grid.Selection.UnselectAll();
                };
                settings.DataBinding = (sender, e) =>
                {
                    ASPxGridView grid = (ASPxGridView)sender;
                    for (int i = 0; i < grid.AllColumns.Count; i++)
                    {
                        if (grid.AllColumns[i].CellStyle.HorizontalAlign == System.Web.UI.WebControls.HorizontalAlign.NotSet)
                        {
                            grid.AllColumns[i].CellStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;
                        }
                        if (grid.AllColumns[i].HeaderStyle.HorizontalAlign == System.Web.UI.WebControls.HorizontalAlign.NotSet)
                        {
                            grid.AllColumns[i].HeaderStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;
                        }
                    }
                };            
                
                
            }).Bind(Model).GetHtml()